import request from '../../utils/request'

const api_name = "stock"

/**查询库存记录列表 */
export function getStocksByCondition(queryCondition) {
    return request({
        url: `/${api_name}/querypage`,
        method: 'post',
        data: queryCondition
    })
}

/**新增库存记录 */
export function addStockRecord(stockinfo) {
    return request({
        url: `/${api_name}/add`,
        method: 'post',
        data: stockinfo
    })
}

/**根据id查询库存记录 */
export function getStockRecordById(id) {
    return request({
        url: `/${api_name}/getbyid/${id}`,
        method: 'GET'
    })
}

/**修改库存记录 */
export function editStockRecord(stockinfo) {
    return request({
        url: `/${api_name}/edit`,
        method: 'PUT',
        data: stockinfo
    })
}

/**删除库存记录 */
export function romoveStockRecord(id) {
    return request({
        url: `/${api_name}/remove/${id}`,
        method: 'DELETE'
    })
}